#define _CRT_SECURE_NO_WARNINGS 1
#include<stdio.h>
#define SWAP(x) (((x&0x55555555)<<1)+((x&0xaaaaaaaa)>>1))
#include<stddef.h>
//int main()
//{
//	int a = 10;
//	a=SWAP(a);
//	printf("%d\n", a);
//	return 0;
//}
#define OFFSETOF(type,member) ((size_t)&(((type*)0)->member))
struct S
{
	char c1;
	int i;
	char c2;
};
int main()
{
	struct S S1 = { 'A',12,'S' };
	printf("%d\n", offsetof(struct S, c1));
	printf("%d\n", offsetof(struct S, i));
	printf("%d\n", offsetof(struct S, c2));
	printf("%d\n", OFFSETOF(struct S, c1));
	printf("%d\n", OFFSETOF(struct S, i));
	printf("%d\n", OFFSETOF(struct S, c2));
	return 0;
}